package day9;

import javax.imageio.ImageIO;
import java.io.IOException;
import java.util.Random;

public class Bee extends BaseClass implements Award{
    int speed;
    int num= (int) (Math.random()*2);
    public Bee(){
        bf=Main.bee;
        width=bf.getWidth();
        height=bf.getHeight();
        x= (int) (Math.random()*400)-width;
        y=-height;
        speed=7;
        blood=1;
    }
    boolean n=true;
    @Override
    public void move() {
        y=y+speed;
        if(x<=350&&n==true){
            x=x+speed;
        }
        if(x>=0&&n==false) {
            x=x-speed;
        }
        if(x>350){
            n=false;
        }
        if(x<0){
            n=true;
        }
    }
    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    @Override
    public int AddAward() {
        return num;
    }
}
